<html>
<head>
	<title>machineClassificationRst</title>
	<script type="text/javascript">
	function ajaxRequest(obj,op,pos){
		var xmlhttp;
		var csrf_token = "{{ csrf_token }}"
		var value = obj.parentNode.parentNode.childNodes[1].innerHTML
		var postData = {"paramName":"{{ paramName }}","value":value,"op":op,"route":"{{ route }}","pos":pos};
		var tar = "/myDetector/dealMLClassificationRst/";
			
		if(window.XMLHttpRequest){
			xmlhttp = new XMLHttpRequest();
		}else{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.open("POST",tar,true);
		xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
		xmlhttp.setRequestHeader("X-CSRFToken",csrf_token)
		xmlhttp.onreadystatechange = function(){
			if(xmlhttp.readyState == 4 && (xmlhttp.status ==200 || xmlhttp.status ==304)){
				if(JSON.parse(xmlhttp.responseText)["response"] == "success" ){
					parentObj = obj.parentNode.parentNode.parentNode;
					parentObj.removeChild(obj.parentNode.parentNode);
				}
			}
		};
		xmlhttp.send(JSON.stringify(postData));
		
	}
	</script>
	<style type="text/css">
	caption{
		color: blue;
		font-size: 30px;
	}
	table{
		width: 1000px;
		margin: 5px auto;
		text-align: center;
		border: 1px solid;
		border-collapse:collapse;
	}
	td{
		border: 1px solid black;
	}
	#Positive{
		color: blue;
		width: 60px;
	}
	#Negative{
		color: red;
		width: 60px;
	}
	</style>
</head>
<body>
<table id="class_one">
<caption>class_one</caption>
{% for value in class_one %}
<tr>
<td>{{ value }}</td>
<td id="Negative"><div onclick=ajaxRequest(this,'confirmBad','0')>confirmBad</div></td>
<td id="Positive"><div onclick=ajaxRequest(this,'confirmGood','0')>confirmGood</div></td>
</tr>
{% endfor %}
</table>

<table id="class_two">
<caption>class_two</caption>
{% for value in class_two %}
<tr>
<td>{{ value }}</td>
<td id="Negative"><div onclick=ajaxRequest(this,'confirmBad','1')>confirmBad</div></td>
<td id="Positive"><div onclick=ajaxRequest(this,'confirmGood','1')>confirmGood</div></td>
</tr>
{% endfor %}
</table>
</body>
</html>